package com.ruoyi.blog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.blog.mapper.BlogLeaveMapper;
import com.ruoyi.blog.domain.BlogLeave;
import com.ruoyi.blog.service.IBlogLeaveService;

/**
 * 博客留言Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-22
 */
@Service
public class BlogLeaveServiceImpl implements IBlogLeaveService 
{
    @Autowired
    private BlogLeaveMapper blogLeaveMapper;

    /**
     * 查询博客留言
     * 
     * @param id 博客留言ID
     * @return 博客留言
     */
    @Override
    public BlogLeave selectBlogLeaveById(Long id)
    {
        return blogLeaveMapper.selectBlogLeaveById(id);
    }

    /**
     * 查询博客留言列表
     * 
     * @param blogLeave 博客留言
     * @return 博客留言
     */
    @Override
    public List<BlogLeave> selectBlogLeaveList(BlogLeave blogLeave)
    {
        return blogLeaveMapper.selectBlogLeaveList(blogLeave);
    }

    /**
     * 新增博客留言
     * 
     * @param blogLeave 博客留言
     * @return 结果
     */
    @Override
    public int insertBlogLeave(BlogLeave blogLeave)
    {
        blogLeave.setCreateTime(DateUtils.getNowDate());
        return blogLeaveMapper.insertBlogLeave(blogLeave);
    }

    /**
     * 修改博客留言
     * 
     * @param blogLeave 博客留言
     * @return 结果
     */
    @Override
    public int updateBlogLeave(BlogLeave blogLeave)
    {
        return blogLeaveMapper.updateBlogLeave(blogLeave);
    }

    /**
     * 批量删除博客留言
     * 
     * @param ids 需要删除的博客留言ID
     * @return 结果
     */
    @Override
    public int deleteBlogLeaveByIds(Long[] ids)
    {
        return blogLeaveMapper.deleteBlogLeaveByIds(ids);
    }

    /**
     * 删除博客留言信息
     * 
     * @param id 博客留言ID
     * @return 结果
     */
    @Override
    public int deleteBlogLeaveById(Long id)
    {
        return blogLeaveMapper.deleteBlogLeaveById(id);
    }
}
